<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>恒铸智能柜管理平台</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/resources/layui/css/layui.css"
	media="all" />
<script type="text/javascript"
	src="${pageContext.request.contextPath}/resources/layui/layui.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/resources/js/cacheUserInfo.js"></script>
<style type="text/css">
.changePwd {
	width: 300px;
}
</style>
<script type="text/javascript">
	layui.use(['jquery','layer', 'form'], function(){
	    var form = layui.form,
	        layer = parent.layer === undefined ? layui.layer : top.layer
	        $ = layui.jquery;
	    
	    form.on("submit(changePwd)",function(data){
	        $.post("/main/updateMyPsssWord",data.field,function(data) {
	        	if(data.success){
	        		layer.msg("修改成功,请重新登录");
	        		 setTimeout(function(){
	        			window.location.href = "/logout";
	        	        },1000);
	        	}else{
	        		layer.msg(data.message);
	        	}
	        });
	    })
	
	})
	
	
	</script>


</head>
<body class="childrenBody">
	<div style="margin: 0 0 15px 110px; color: #f00;">管理员默认密码为:hengzhu123，新密码必须两次输入一致才能提交</div>
	<form class="layui-form changePwd">
		<div class="layui-form-item">
			<label class="layui-form-label">用户名</label>
			<div class="layui-input-block">
				<input type="text" value=${ loginUser.loginName } disabled
					class="layui-input layui-disabled">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">旧密码</label>
			<div class="layui-input-block">
				<input type="password" name="oldPassWord" autocomplete="off"
					placeholder="请输入旧密码" lay-verify="required" id="oldPassword"
					class="layui-input ">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">新密码</label>
			<div class="layui-input-block">
				<input type="password" name="newPassWord" autocomplete="off"
					placeholder="请输入新密码" lay-verify="required" id="newPassWord"
					class="layui-input ">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">确认密码</label>
			<div class="layui-input-block">
				<input type="password" name="surePassWord" autocomplete="off"
					placeholder="请确认密码" lay-verify="required" id="surePassWord"
					class="layui-input ">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<a class="layui-btn" lay-submit lay-filter="changePwd">立即修改</a>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>

</body>
</html>